﻿using FB.Membership.Principal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Http;

namespace FB.Mvc.Controllers
{
    public abstract class BaseApiController : ApiController
    {
        public FBIdentity FBIdentity
        {
            get
            {
                if (User.Identity is FBIdentity)
                {
                    return (FBIdentity)User.Identity;
                }
                else
                {
                    return null;
                }
            }
        }

        public FBPrincipal FBPrincipal
        {
            get
            {
                return (User is FBPrincipal) ? (FBPrincipal)User : null;
            }
        }
    }
}
